package com.liu.auth.feign.api;

import com.liu.shop.common.utils.R;
import com.liu.shop.common.vo.ThirdUser;
import com.liu.shop.common.vo.UserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

// 根据注册到eureka中的模块名字进行模块调用，并加上想要请求的路径
@FeignClient(name = "shop-user",path = "user/user")
public interface UserServices {
    @PostMapping("/findByName")
    public UserVo findByName(@RequestParam("field") String field, @RequestParam("value") String value);

    @PostMapping("/save")
    R register(UserVo userVo);

    @GetMapping("/queryUser")
    UserVo queryUser(@RequestParam String name);

    @RequestMapping("/update")
    void updatePwd(UserVo userVo);

    @PostMapping("/findThirdUser")
    ThirdUser findThirdUser(@RequestParam("field") String field, @RequestParam("value") String value);

    @PostMapping("/saveThirdUser")
    R registerThirdUser(ThirdUser thirdUser);
}
